package com.wc.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * 封装用户类
 * 
 * @author ysh
 */
public class User implements Serializable {


	private static final long serialVersionUID = 1L;
	private Integer userid;// 主键id
	private String name;// 用户名
	private String idcard;// 身份证号码
	private String mobiile;// 手机号码
	private String address;// 地址
	/*
		ResponseBody后端传给前端的json数据中如果有一个是时间对象，它会自动序列化成一串数字（时间戳）
		这时就需要用到这个JsonFormat注解来指定json数据中的时间对象格式
		SELECT * FROM `t_xm` xm,`t_tree` t WHERE xm.`p_id` = t.`t_id`

SELECT * FROM `t_xm` xm,`t_userinfo` u WHERE xm.`xm_id` = u.xmid
	 */
	@JsonFormat(pattern="yyyy-MM-dd HH:mm",timezone = "GMT+8")
	@DateTimeFormat(pattern="yyyy-MM-dd HH:mm")
	private Date birtday;// 出生日期
	private String age;// 年龄

	public Integer getUserid() {
		return userid;
	}

	public void setUserid(Integer userid) {
		this.userid = userid;
	}

	public void setBirtday(Date birtday) {
		this.birtday = birtday;
	}

	public User() {
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getIdcard() {
		return idcard;
	}

	public void setIdcard(String idcard) {
		this.idcard = idcard;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public Date getBirtday() {
		return birtday;
	}

	public String getMobiile() {
		return mobiile;
	}

	public void setMobiile(String mobiile) {
		this.mobiile = mobiile;
	}

	public String getAge() {
		return age;
	}

	public void setAge(String age) {
		this.age = age;
	}

	@Override
	public String toString() {
		return "User [userid=" + userid + ", name=" + name + ", idcard=" + idcard + ", mobiile=" + mobiile
				+ ", address=" + address + ", birtday=" + birtday + ", age=" + age + "]";
	}


}
